import type {
  VxeGridInstance,
  VxeGridPropTypes,
  VxeTablePropTypes,
   VxeTableInstance,
   VxeTableDefines,
  VxeGridEvents,
  VxeGridProps
} from 'vxe-table'

export interface PageInfo {
  currentPage: number
  pageSize: number
  pageSizes: number[]
  total: number
}

export interface Column {
  field: string
  title: string
  type?: 'seq' | 'checkbox' | 'radio'
  width?: number | string
  minWidth?: number | string
  fixed?: 'left' | 'right'
  sortable?: boolean
  hide?: boolean
  filters?: any[]
  filterMethod?: VxeGridPropTypes.FilterMethod
  editRender?: any
  showOverflow?: boolean
  is_filter?: boolean
}

export interface ExportConfig extends VxeTableDefines.ExportConfigOptions {
  types?: string[]
  type?: 'csv' | 'txt' | 'html' | 'xml' | 'xlsx'
  original?: boolean
  download?: boolean
  filename?: string | ((params: { $table: VxeTableInstance }) => string)
  data?: any[]
  columns?: VxeTableDefines.ColumnInfo[]
  columnFilterMethod?: (column: VxeTableDefines.ColumnInfo) => boolean
  isHeader?: boolean
  isFooter?: boolean
  isColgroup?: boolean
  isMerge?: boolean
  mode?: 'current' | 'selected' | 'all'
  modes?: string[]
  style?: string
  remote?: boolean
  url?: string
  method?: 'get' | 'post' | 'put' | 'delete'
  headers?: Record<string, string>
  params?: any
  withCredentials?: boolean
  useStyle?: boolean
  sheetName?: string
  sheetId?: string
  message?: boolean
  showProgress?: boolean
  progressMessage?: string
  beforeExportMethod?: (params: { $table: VxeTableInstance; options: ExportConfig }) => Promise<boolean> | boolean
  afterExportMethod?: (params: { $table: VxeTableInstance; options: ExportConfig }) => void
}